package net.hnedu.tag;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;
import java.io.IOException;
import javax.servlet.jsp.JspTagException;
import net.hnedu.factory.ResDisplay;

public class VoteTag  extends TagSupport{
  public VoteTag() {
  }

  private String voteid;
  public String getVoteid() {
    return voteid;
  }
  public void setVoteid(String voteid) {
    this.voteid = voteid;
  }

  public int doStartTag() throws JspException {
    try {
      JspWriter out = pageContext.getOut();
      String str = ResDisplay.displayVote(voteid);
      out.write(str);
    }
    catch (IOException e) {
      throw new JspTagException(e.getMessage());
    }
    return EVAL_PAGE;
  }

}
